<%--
  Created by Pavel
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">
<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-language" content="cs" />
<meta name="robots" content="all,follow" />

<title>ProjectBox</title>
<meta name="description" content="..." />
<meta name="keywords" content="..." />

<!--  <link rel="index" href="./" title="Home" /> -->
<link rel="stylesheet" media="screen,projection" type="text/css"
	href="<c:url value='/css/mainForOtherPages.css' />" />
<link rel="stylesheet" media="print" type="text/css"
	href="<c:url value='/css/print.css' />" />
<link rel="stylesheet" media="aural" type="text/css"
	href="<c:url value='/css/aural.css' />" />
<link rel="stylesheet" type="text/css"
	href="<c:url value='/css/tcal.css' />" />
<link rel="stylesheet" type="text/css"
	href="<c:url value='/css/button.css' />" />
<link rel="stylesheet" type="text/css"
	href="<c:url value='/css/jquery.qtip.css' />" />
<script type="text/javascript" src="<c:url value='/js/tcal.js' />"></script>
<script type="text/javascript"
	src="<c:url value='/js/userResourceList.js' />"></script>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript"
	src="http://yui.yahooapis.com/2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript"
	src="http://yui.yahooapis.com/2.9.0/build/json/json-min.js"></script>
<script type="text/javascript"
	src="http://yui.yahooapis.com/2.9.0/build/connection/connection-min.js"></script>
	<script type="text/javascript" src="<c:url value='/js/jquery.qtip.js' />"></script>
	<script type="text/javascript" src="<c:url value='/js/tooltips.js' />"></script>

<title>ProjectBox</title>

<script type="text/javascript">
	putUserResources("<c:url value='/resourceList'/>");
	function checkBoxValidate(cb) {
		for (j = 0; j < 4; j++) {
			if (eval("document.searchForm.ckbox[" + j + "].checked") == true) {
				document.searchForm.ckbox[j].checked = false;
				if (j == cb) {
					document.searchForm.ckbox[j].checked = true;
				}
			}
		}
	}

	function emptySearchString() {
		document.getElementById("searchString").value = "";
	}
	
	function emptyTopSearchBox() {
		
		document.getElementById("search-input").value = "";
	}
	
	function oneBoxChecked(){
		
		for (j = 0; j < 4; j++) {
			if (eval("document.searchForm.ckbox[" + j + "].checked") == true) {
				return true;
			}
		}
		
		return false;
	}
	
	function validateSearchString() {
		if (document.getElementById("searchString").value == ''
				|| document.getElementById("searchString").value == 'Search!') {
			return false;
		} else if (!oneBoxChecked()){
			
			return false;
		}
		else {
			return tue;
		}
	}

	function getDates() {
		var currentTime = new Date();
		var month = currentTime.getMonth() + new Number("1");
		var time = currentTime.getFullYear() + "-" + month + "-"
				+ currentTime.getDate();
		document.getElementById("startDate").value = time;
		document.getElementById("endDate").value = time;
	}
	
	function simple_tooltip(target_items, name){
		 $(target_items).each(function(i){
				$("body").append("<div class='"+name+"' id='"+name+i+"'><p>"+$(this).attr('title')+"</p></div>");
				var my_tooltip = $("#"+name+i);

				$(this).removeAttr("title").mouseover(function(){
						my_tooltip.css({opacity:0.8, display:"none"}).fadeIn(400);
				}).mousemove(function(kmouse){
						my_tooltip.css({left:kmouse.pageX+15, top:kmouse.pageY+15});
				}).mouseout(function(){
						my_tooltip.fadeOut(400);
				});
			});
		}
		$(document).ready(function(){
			 simple_tooltip("","tooltip");
		});
		
</script>
</head>
<body onload="javascript:getDates()">

	<!-- Main -->
	<div id="main" class="box">

		<!-- Header -->
		<div id="header">

			<!-- Logotyp -->
			<img alt="" src="<c:url value='/design/logo.png'/>" class="logo" />
			<hr class="noscreen" />


			<!-- Quick links -->
			<div class="noscreen noprint">
				<p>
					<em>Quick links: <a href="#content">content</a>, <a
						href="#tabs">navigation</a>, <a href="#search">search</a>.
					</em>
				</p>
				<hr />
			</div>

			<!-- Search -->
			<div id="search" class="noprint">
				<form action="<c:url value='/search/doSearch'/>" method="GET">
					<fieldset>
						<legend>Search</legend>
						<label><span class="noscreen">Find:</span> <span
							id="search-input-out"><input type="text"
								id="search-input" name="search-input" size="30" placeholder="Search Projects" onclick="javascript:emptyTopSearchBox()"/> </span> </label> 
								<input type="image" src="design/search_submit.gif" id="search-submit" ALT="Submit Form" border="0" value=”Submit”/>
					</fieldset>
				</form>
			</div>
			<!-- /search -->

		</div>
		<!-- /header -->

		<!-- Main menu (tabs) -->
		<div id="tabs" class="noprint">

			<h3 class="noscreen">Navigation</h3>
			<ul class="box">
				<li><a href="<c:url value='/announcement'/>">Announcements<span
						class="tab-l"></span><span class="tab-r"></span>
				</a></li>
				<li><a href="<c:url value='/myproject'/>">Projects<span
						class="tab-l"></span><span class="tab-r"></span>
				</a></li>
				<li id="active"><a href="#">Search<span class="tab-l"></span><span
						class="tab-r"></span>
				</a></li>
				<!-- Active -->
				<li><a href="<c:url value='/rule' />">Rules<span
						class="tab-l"></span><span class="tab-r"></span>
				</a></li>
			</ul>
			<div  class="f-right" style="margin-right:20px; margin-bottom:20px; font-weight: bold; color: #FF9000;">
				Hi, ${user.firstName} ${user.lastName} | <a href="<c:url value='/logout' />">Logout</a>
			</div>
			<hr class="noscreen" />
		</div>
		<!-- /tabs -->

		<!-- Page (2 columns) -->
		<div id="page" class="box">
			<div id="page-in" class="box">

				<!-- Content -->
				<div id="content">

					<!-- Article -->
					<div class="article">
						<h2>
							<span>Search</span>
						</h2>
						
						<form name="searchForm" action="<c:url value='/search/doSearch'/>"
							onsubmit="return validateSearchString()" method="get">

							<table cellpadding="0" cellspacing="0" style="border: hidden">
								<tr style="border: hidden">
									<td style="border: hidden"><input type="text"
										name="searchString" id="searchString" width="140"
										placeholder="Search!" onclick="javascript:emptySearchString()" /></td>
									<td style="border: hidden">Start Date&nbsp;&nbsp;&nbsp;&nbsp;<input type="date" class="tcal"
										name="startDate" id="startDate" width="30" /> <br />
									</td>
								</tr>

								<tr style="border: hidden">
									<td style="border: hidden"><input type="checkbox"
										name="ckbox" id="defaultBox" value="projects"
										checked='checked' onClick="javascript:checkBoxValidate(0)" />
										Projects</td>
									<td style="border: hidden">End Date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input
										type="date" name="endDate" id="endDate" class="tcal"
										width="30" />
									</td>
								</tr>

								<tr style="border: hidden">
									<td style="border: hidden"><input type="checkbox"
										name="ckbox" value="myResources"
										onClick="javascript:checkBoxValidate(1)" /> My Resources</td>
								</tr>
								<tr style="border: hidden">
									<td style="border: hidden"><input type="checkbox"
										name="ckbox" value="AllResources"
										onClick="javascript:checkBoxValidate(2)" /> All Resources</td>
								</tr>
								<tr style="border: hidden">
									<td style="border: hidden"><input type="checkbox"
										name="ckbox" value="resourceTypes"
										onClick="javascript:checkBoxValidate(3)" /> File Type</td>
								</tr>
								<tr>
									<td style="border: hidden">
									</td>
								</tr>
								<tr style="border: hidden">
									<td style="border: hidden"><input type="submit"
										class="obutton" value="Search" /></td>
								</tr>
							</table>

						</form>
					</div>
		
					<!-- /article -->

					<hr class="noscreen" />
				</div>
				<!-- /content -->
				<!-- Right column -->
				<div id="col" class="noprint">
					<div id="col-in">
						<!-- About Me 
						<h3>
							<span>About Me</span>
						</h3>

						<div id="about-me">
							<strong>${user.firstName} ${user.lastName}</strong><br /> Age:
							26<br /> Dallas, TX<br />

						</div>
						-->
						<!-- /about-me 

						<hr class="noscreen" />
						-->
						
						<!-- Category -->
						<h3>Projects</h3>

						<ul id="category">
							<li><a href="<c:url value='/newproject' />">Create
									Project</a></li>
							<li><a href="<c:url value='/myproject' />">My Projects</a></li>
							<li><a href="<c:url value='/contribute' />">Contributed
									Projects</a></li>
							<li><a href="<c:url value='/project' />">Other Projects</a>
							</li>
						</ul>

						<hr class="noscreen" />

						<!-- Archive -->
						<h3>
							<span>Latest Resources</span>
						</h3>
					</div>
					<!-- /col-in -->
				</div>
				<!-- /col -->

			</div>
			<!-- /page-in -->
		</div>
		<!-- /page -->

		<!-- Footer -->
		<div id="footer">
			
			<div id="top" class="noprint">
				<p>
					<span class="noscreen">Back on top</span> <a href="#header"
						title="Back on top ^">^<span></span>
					</a>
				</p>
			</div>
			<hr class="noscreen" />
			

			<p id="createdby">
				created by <a href="http://www.nuvio.cz">Nuvio | Webdesign</a>
				<!-- DON´T REMOVE, PLEASE! -->
			</p>
			<p id="copyright">
				&copy; 2012 <a href="mailto:mss.projectbox@gmail.com">ProjectBox Team</a>
			</p>
		</div>
		<!-- /footer -->

	</div>
	<!-- /main -->
	<script type="text/javascript">
// Create the tooltips only on document load
$(document).ready(function() 
{
	loadToolTips("<c:url value='/dummyUrl'/>");

});
</script>
<script src="<c:url value='/js/resource.js' />" type="text/javascript"></script>
</body>
</html>